#ifndef XYCALL_H
#define XYCALL_H

#include <QObject>
#include <pjsua2/endpoint.hpp>
#include <pjsua2/account.hpp>
#include <pjsua2/call.hpp>
#include <pjsua2/media.hpp>


class XyCall : public QObject,public pj::Call
{
    Q_OBJECT
public:
    explicit XyCall(pj::Account& acc, QObject *parent = nullptr, int call_id = PJSUA_INVALID_ID);

signals:


    // Call interface
public:
    virtual void onCallState(pj::OnCallStateParam &prm) override;
    virtual void onCallTsxState(pj::OnCallTsxStateParam &prm) override;
    virtual void onCallMediaState(pj::OnCallMediaStateParam &prm) override;
    virtual void onCallSdpCreated(pj::OnCallSdpCreatedParam &prm) override;
    virtual void onStreamCreated(pj::OnStreamCreatedParam &prm) override;
    virtual void onStreamDestroyed(pj::OnStreamDestroyedParam &prm) override;
    virtual void onDtmfDigit(pj::OnDtmfDigitParam &prm) override;
    virtual void onCallTransferRequest(pj::OnCallTransferRequestParam &prm) override;
    virtual void onCallTransferStatus(pj::OnCallTransferStatusParam &prm) override;
    virtual void onCallReplaceRequest(pj::OnCallReplaceRequestParam &prm) override;
    virtual void onCallReplaced(pj::OnCallReplacedParam &prm) override;
    virtual void onCallRxOffer(pj::OnCallRxOfferParam &prm) override;
    virtual void onCallRxReinvite(pj::OnCallRxReinviteParam &prm) override;
    virtual void onCallTxOffer(pj::OnCallTxOfferParam &prm) override;
    virtual void onInstantMessage(pj::OnInstantMessageParam &prm) override;
    virtual void onInstantMessageStatus(pj::OnInstantMessageStatusParam &prm) override;
    virtual void onTypingIndication(pj::OnTypingIndicationParam &prm) override;
    virtual pjsip_redirect_op onCallRedirected(pj::OnCallRedirectedParam &prm) override;
    virtual void onCallMediaTransportState(pj::OnCallMediaTransportStateParam &prm) override;
    virtual void onCallMediaEvent(pj::OnCallMediaEventParam &prm) override;
    virtual void onCreateMediaTransport(pj::OnCreateMediaTransportParam &prm) override;
    virtual void onCreateMediaTransportSrtp(pj::OnCreateMediaTransportSrtpParam &prm) override;
private:
    pj::AudioMedia m_xySpeaker;
    pj::AudioMedia m_xyMicro;
    pj::AudioMedia m_xyRemote;
    pj::Account& m_xyAccount;
};

#endif // XYCALL_H
